<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

</body>
<script>
//es6,旧数组生成新数组map
let currentYear = new Date().getFullYear()
/*
let l = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
let yearList = l.map((t,i)=>{
  return currentYear+i-5
})
console.log(yearList)
*/
// 类数组(伪数组)
// 有length, 可以通过索引值访问, 有没数组方法

// 可以
/*
let l = Array.from({length: 11})
l.map(t=>{
  console.log('t',t)
})
*/
// 可以
/*
let l = Array.from(Array(11))
let yearList = l.map((t,i)=>{
  return currentYear+i-5
})
*/
/*
let yearList = Array.from(Array(11), (t,i)=>{
//   return currentYear+i-5
// })
*/
let yearList = Array.from(Array(11), (t,i)=> currentYear+i-5)
console.log(yearList)
</script>
</html>
